<template>
  <div class="content">
    <button @click="home">首页</button>
    <button @click="http">发一个Axios请求</button>
    <my-footer txt="首页" />
  </div>
</template>

<script>
import myFooter from '~/components/footer.vue'
export default {
  components: {
    myFooter
  },
  created() {
  },
  methods: {
    home() {
      this.$router.push('/user/')
    },
    http() {
      this.$axios({ url: 'api/login', method: 'post', data: {
        type: 'pwd',
        tel: '111',
        code: '222'
      }}).then(res => {
        alert('请求数据成功!')
      }).catch(() => {})
    }
  }
}
</script>

<style scoped lang="stylus">
  .content
    button
      background-color transparent
      border 1px solid #ccc
      border-radius 6px
      font-size 20px
</style>
